/**
 * @ author: 汪孟苹
 */
define(["jquery","bbcare",
	"scprit/followup/app/outPatient/outPatient.servers.js",
	"scprit/followup/app/outPatient/outPatient.ui.js", 
	"scprit/followup/app/outPatient/outPatient.event.js"
	],
	function($,$bb,$outPatientServers,$outPatientUi,$outPatientEvent){
	var outPatient = {};

	/**
	 * 基本信息的ui（在该页面进行操作时，不会再发生变化的ui）
	 */
	var remainUi = function(params){
		$outPatientUi.FollowUpTitInit({		// 问卷的标题
			id: "followUpTit",
			queueName: params.queuename
		});
	}
	outPatient.init = function(){
		var params = $outPatientServers.getPageParams();
		if(params){
			remainUi(params);
			var topbars = [
				{
					"icon":"fa fa-trash-o",
					"name":"删除患者",
					"callback":$outPatientEvent.onPatientDelect,
					"params":$outPatientServers.getDeleteParams()
				}
			];
			$bb.toolbar(topbars);
			$outPatientServers.ajaxTasks($outPatientEvent.getTasksCallback,params);		//请求任务列表
			if( params.unchecked && params.unchecked == "1" ) {
				$("#topbar").css({"display":"none"});
			}
		}else{
			//患者实例ID不存在时的异常操作代码
			$bb.toastShow("加载门诊录入页面失败");
		}	
	}; 
	
	return outPatient;
});
